<?php
/**
 * Created by PhpStorm.
 * User: Dmitry
 * Date: 02.03.2015
 * Time: 16:04
 */

class SessionManager {

    var $lifeTime = 720;
    var $sessionData = array();

    public function  __construct()
    {
        $this->startSession();
    }

    function startSession()
    {
        if(!isset($_SESSION)) {
            session_start();
        }
        $this->sessionData = $_SESSION;
    }

    function closeSession()
    {
        $_SESSION = $this->sessionData;
        session_write_close();
    }

    function  clearSession()
    {
        $_SESSION = array();
    }





}